<template>
	<view class="content">
		<view class="line alpsoftjurnal" v-for="(item, index) in list" :key="index" @click="itemFn(item.value)">
			{{item.text}}
			<uni-icons v-if="language == item.value" type="checkmarkempty" size="20"></uni-icons>
		</view>
	</view>
</template>

<script>
import util from '../../utils/util';
	export default {
		data() {
			return {
				list: [{
					text: '简体中文',
					value: 'cn'
				}, {
					text: 'ئۇيغۇر',
					value: 'wwe'
				}],
				language: 'cn'
			}
		},
		onLoad() {
			console.log(1, uni.getLocale());
			if(uni.getStorageSync('language')) {
				this.language = uni.getStorageSync('language')
			}
			util.setNavTitle()
		},
		methods: {
			itemFn(val) {
				this.language = val
				this.$i18n.locale = val
				uni.setStorageSync('language', val)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		.line {
			padding: 40rpx;
			font-size: 32rpx;
			border-bottom: 1px solid #eff0f4;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
	}
</style>